/*
 * Copyright 2018 JDCLOUD.COM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http:#www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Video Quality Detection
 * 视频质量检测相关接口
 *
 * OpenAPI spec version: v1
 * Contact: 
 *
 * NOTE: This class is auto generated by the jdcloud code generator program.
 */


using JDCloudSDK.Core.Auth;
using JDCloudSDK.Core.Client;
using JDCloudSDK.Core.Http;
using JDCloudSDK.Vqd.Apis;
using JDCloudSDK.Vqd.Model;
using System;
using System.Collections.Generic;
using System.Text;
#if NET40||NET35
#else
using System.Threading.Tasks;
#endif

namespace JDCloudSDK.Vqd.Client
{
    /// <summary>
    ///  Video Quality Detection
    ///  视频质量检测相关接口
    ///  Vqd Api 客户端
    ///</summary>
    public class VqdClient : JdcloudClient
    {

        /// <summary>
        ///  默认私有构造函数
        /// </summary>
        private VqdClient()
        {

        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        /// <param name="credentialsProvider">认证信息</param>
        /// <param name="httpRequestConfig">http 客户端配置信息</param>
        /// <param name="environment">sdk 环境配置信息</param>
        public VqdClient(CredentialsProvider credentialsProvider, HttpRequestConfig httpRequestConfig,SDKEnvironment environment)
        {
            this.httpRequestConfig = httpRequestConfig;
            this.credentialsProvider = credentialsProvider;
            this.environment = environment;
        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        /// <param name="httpRequestConfig">http 客户端配置信息</param>
        /// <param name="credentialsProvider">认证信息</param>
        public VqdClient(CredentialsProvider credentialsProvider,HttpRequestConfig httpRequestConfig)
        {
            this.httpRequestConfig = httpRequestConfig;
            this.credentialsProvider = credentialsProvider;
        }

        /// <summary>
        /// 默认构造函数，
        /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https
        /// </summary>
        /// <param name="credentialsProvider">认证信息</param>
        public VqdClient(CredentialsProvider credentialsProvider)
        {
            this.credentialsProvider = credentialsProvider;
        }

        /// <summary>
        ///  版本号 1.2.0
        ///</summary>
        public const string ClientVersion = "1.2.0";

        private const string apiVersion = "v1";
        private const string userAgentPrefix = "JdcloudSdkDotNet";
        private const string defaultEndpoint = "vqd.jdcloud-api.com";
        private const string serviceName = "vqd";
        private const string userAgent = userAgentPrefix + "/" + ClientVersion + " " + serviceName + "/" + apiVersion;


        private SDKEnvironment environment = new SDKEnvironment(defaultEndpoint);
        private CredentialsProvider credentialsProvider;
        private HttpRequestConfig httpRequestConfig;

        /// <summary>
        ///  获取证书信息
        ///</summary>
        public override CredentialsProvider CredentialsProvider   { get { return credentialsProvider; } }

        /// <summary>
        ///  获取http 客户端配置信息
        ///</summary>
        public override HttpRequestConfig HttpRequestConfig { get { return httpRequestConfig; } }

        /// <summary>
        ///  获取sdk环境配置信息
        ///</summary>
        public override SDKEnvironment SDKEnvironment { get { return environment; } }

        /// <summary>
        ///  获取用户自定义浏览器识别字符串
        ///</summary>
        public override string UserAgent { get { return userAgent; } }

        /// <summary>
        ///  获取服务名称
        ///</summary>
        public override string ServiceName { get { return serviceName; } }

        /// <summary>
        ///  获取版本号
        ///</summary>
        public override string Version { get { return apiVersion; } }



#if NET40||NET35
        /// <summary>
        ///  删除视频质检模板
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteVqdTemplateResponse DeleteVqdTemplate(DeleteVqdTemplateRequest request) {
            return  new DeleteVqdTemplateExecutor().Client(this).Execute<DeleteVqdTemplateResponse, DeleteVqdTemplateResult, DeleteVqdTemplateRequest>(request);
        }
#else
        /// <summary>
        ///  删除视频质检模板
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteVqdTemplateResponse> DeleteVqdTemplate(DeleteVqdTemplateRequest request) {
            return await new DeleteVqdTemplateExecutor().Client(this).Execute<DeleteVqdTemplateResponse, DeleteVqdTemplateResult, DeleteVqdTemplateRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  批量删除视频质检任务。删除任务时，会同时删除任务相关的数据，如任务执行结果等。一次最多删除50条
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public BatchDeleteVqdTasksResponse BatchDeleteVqdTasks(BatchDeleteVqdTasksRequest request) {
            return  new BatchDeleteVqdTasksExecutor().Client(this).Execute<BatchDeleteVqdTasksResponse, BatchDeleteVqdTasksResult, BatchDeleteVqdTasksRequest>(request);
        }
#else
        /// <summary>
        ///  批量删除视频质检任务。删除任务时，会同时删除任务相关的数据，如任务执行结果等。一次最多删除50条
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<BatchDeleteVqdTasksResponse> BatchDeleteVqdTasks(BatchDeleteVqdTasksRequest request) {
            return await new BatchDeleteVqdTasksExecutor().Client(this).Execute<BatchDeleteVqdTasksResponse, BatchDeleteVqdTasksResult, BatchDeleteVqdTasksRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询视频质检模板列表。
        /// 支持过滤查询：
        ///   - templateId,eq 精确匹配模板ID，非必选
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ListVqdTemplatesResponse ListVqdTemplates(ListVqdTemplatesRequest request) {
            return  new ListVqdTemplatesExecutor().Client(this).Execute<ListVqdTemplatesResponse, ListVqdTemplatesResult, ListVqdTemplatesRequest>(request);
        }
#else
        /// <summary>
        ///  查询视频质检模板列表。
        /// 支持过滤查询：
        ///   - templateId,eq 精确匹配模板ID，非必选
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ListVqdTemplatesResponse> ListVqdTemplates(ListVqdTemplatesRequest request) {
            return await new ListVqdTemplatesExecutor().Client(this).Execute<ListVqdTemplatesResponse, ListVqdTemplatesResult, ListVqdTemplatesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询回调配置
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public QueryCallbackResponse QueryCallback(QueryCallbackRequest request) {
            return  new QueryCallbackExecutor().Client(this).Execute<QueryCallbackResponse, QueryCallbackResult, QueryCallbackRequest>(request);
        }
#else
        /// <summary>
        ///  查询回调配置
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<QueryCallbackResponse> QueryCallback(QueryCallbackRequest request) {
            return await new QueryCallbackExecutor().Client(this).Execute<QueryCallbackResponse, QueryCallbackResult, QueryCallbackRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取视频质检任务详细信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public GetVqdTaskResponse GetVqdTask(GetVqdTaskRequest request) {
            return  new GetVqdTaskExecutor().Client(this).Execute<GetVqdTaskResponse, GetVqdTaskResult, GetVqdTaskRequest>(request);
        }
#else
        /// <summary>
        ///  获取视频质检任务详细信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<GetVqdTaskResponse> GetVqdTask(GetVqdTaskRequest request) {
            return await new GetVqdTaskExecutor().Client(this).Execute<GetVqdTaskResponse, GetVqdTaskResult, GetVqdTaskRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询视频质检模板
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public GetVqdTemplateResponse GetVqdTemplate(GetVqdTemplateRequest request) {
            return  new GetVqdTemplateExecutor().Client(this).Execute<GetVqdTemplateResponse, GetVqdTemplateResult, GetVqdTemplateRequest>(request);
        }
#else
        /// <summary>
        ///  查询视频质检模板
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<GetVqdTemplateResponse> GetVqdTemplate(GetVqdTemplateRequest request) {
            return await new GetVqdTemplateExecutor().Client(this).Execute<GetVqdTemplateResponse, GetVqdTemplateResult, GetVqdTemplateRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询视频质检任务列表
        /// 支持过滤查询：
        ///   - createTime,ge 最早任务创建时间
        ///   - createTime,le 最晚任务创建时间
        ///   - status,in 任务状态
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ListVqdTasksResponse ListVqdTasks(ListVqdTasksRequest request) {
            return  new ListVqdTasksExecutor().Client(this).Execute<ListVqdTasksResponse, ListVqdTasksResult, ListVqdTasksRequest>(request);
        }
#else
        /// <summary>
        ///  查询视频质检任务列表
        /// 支持过滤查询：
        ///   - createTime,ge 最早任务创建时间
        ///   - createTime,le 最晚任务创建时间
        ///   - status,in 任务状态
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ListVqdTasksResponse> ListVqdTasks(ListVqdTasksRequest request) {
            return await new ListVqdTasksExecutor().Client(this).Execute<ListVqdTasksResponse, ListVqdTasksResult, ListVqdTasksRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询视频质检任务结果
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public QueryVqdTaskResultResponse QueryVqdTaskResult(QueryVqdTaskResultRequest request) {
            return  new QueryVqdTaskResultExecutor().Client(this).Execute<QueryVqdTaskResultResponse, QueryVqdTaskResultResult, QueryVqdTaskResultRequest>(request);
        }
#else
        /// <summary>
        ///  查询视频质检任务结果
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<QueryVqdTaskResultResponse> QueryVqdTaskResult(QueryVqdTaskResultRequest request) {
            return await new QueryVqdTaskResultExecutor().Client(this).Execute<QueryVqdTaskResultResponse, QueryVqdTaskResultResult, QueryVqdTaskResultRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  设置回调配置
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public SetCallbackResponse SetCallback(SetCallbackRequest request) {
            return  new SetCallbackExecutor().Client(this).Execute<SetCallbackResponse, SetCallbackResult, SetCallbackRequest>(request);
        }
#else
        /// <summary>
        ///  设置回调配置
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<SetCallbackResponse> SetCallback(SetCallbackRequest request) {
            return await new SetCallbackExecutor().Client(this).Execute<SetCallbackResponse, SetCallbackResult, SetCallbackRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  批量提交视频质检任务，一次同时最多提交50个输入媒体
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public BatchSubmitVqdTasksResponse BatchSubmitVqdTasks(BatchSubmitVqdTasksRequest request) {
            return  new BatchSubmitVqdTasksExecutor().Client(this).Execute<BatchSubmitVqdTasksResponse, BatchSubmitVqdTasksResult, BatchSubmitVqdTasksRequest>(request);
        }
#else
        /// <summary>
        ///  批量提交视频质检任务，一次同时最多提交50个输入媒体
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<BatchSubmitVqdTasksResponse> BatchSubmitVqdTasks(BatchSubmitVqdTasksRequest request) {
            return await new BatchSubmitVqdTasksExecutor().Client(this).Execute<BatchSubmitVqdTasksResponse, BatchSubmitVqdTasksResult, BatchSubmitVqdTasksRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除视频质检任务。删除任务时，会同时删除任务相关的数据，如任务执行结果等
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteVqdTaskResponse DeleteVqdTask(DeleteVqdTaskRequest request) {
            return  new DeleteVqdTaskExecutor().Client(this).Execute<DeleteVqdTaskResponse, DeleteVqdTaskResult, DeleteVqdTaskRequest>(request);
        }
#else
        /// <summary>
        ///  删除视频质检任务。删除任务时，会同时删除任务相关的数据，如任务执行结果等
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteVqdTaskResponse> DeleteVqdTask(DeleteVqdTaskRequest request) {
            return await new DeleteVqdTaskExecutor().Client(this).Execute<DeleteVqdTaskResponse, DeleteVqdTaskResult, DeleteVqdTaskRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  创建视频质检模板
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CreateVqdTemplateResponse CreateVqdTemplate(CreateVqdTemplateRequest request) {
            return  new CreateVqdTemplateExecutor().Client(this).Execute<CreateVqdTemplateResponse, CreateVqdTemplateResult, CreateVqdTemplateRequest>(request);
        }
#else
        /// <summary>
        ///  创建视频质检模板
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CreateVqdTemplateResponse> CreateVqdTemplate(CreateVqdTemplateRequest request) {
            return await new CreateVqdTemplateExecutor().Client(this).Execute<CreateVqdTemplateResponse, CreateVqdTemplateResult, CreateVqdTemplateRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  修改视频质检模板
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UpdateVqdTemplateResponse UpdateVqdTemplate(UpdateVqdTemplateRequest request) {
            return  new UpdateVqdTemplateExecutor().Client(this).Execute<UpdateVqdTemplateResponse, UpdateVqdTemplateResult, UpdateVqdTemplateRequest>(request);
        }
#else
        /// <summary>
        ///  修改视频质检模板
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UpdateVqdTemplateResponse> UpdateVqdTemplate(UpdateVqdTemplateRequest request) {
            return await new UpdateVqdTemplateExecutor().Client(this).Execute<UpdateVqdTemplateResponse, UpdateVqdTemplateResult, UpdateVqdTemplateRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  提交视频质检任务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public SubmitVqdTaskResponse SubmitVqdTask(SubmitVqdTaskRequest request) {
            return  new SubmitVqdTaskExecutor().Client(this).Execute<SubmitVqdTaskResponse, SubmitVqdTaskResult, SubmitVqdTaskRequest>(request);
        }
#else
        /// <summary>
        ///  提交视频质检任务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<SubmitVqdTaskResponse> SubmitVqdTask(SubmitVqdTaskRequest request) {
            return await new SubmitVqdTaskExecutor().Client(this).Execute<SubmitVqdTaskResponse, SubmitVqdTaskResult, SubmitVqdTaskRequest>(request).ConfigureAwait(false);
        }
#endif

            /// <summary>
            ///  默认VqdClient 构造器 接口
            ///</summary>
            public interface Builder
            {

                /// <summary>
                /// 设置认证信息参数
                /// </summary>
                /// <param name="provider">认证信息提供对象</param>
                /// <returns>vqdClient 构造器</returns>
                Builder CredentialsProvider(CredentialsProvider provider);

                /// <summary>
                /// 设置请求环境参数
                /// </summary>
                /// <param name="environment">环境参数信息</param>
                /// <returns>vqdClient 构造器</returns>
                Builder Environment(Core.Client.SDKEnvironment environment);

                /// <summary>
                /// http 请求配置信息
                /// </summary>
                /// <param name="config">http 请求配置信息</param>
                /// <returns>vqdClient 构造器</returns>
                Builder HttpRequestConfig(HttpRequestConfig config);

                /// <summary>
                ///  构造VqdClient 对象
                ///</summary>
                VqdClient Build();
            }

            /// <summary>
            ///  默认VqdClient 构造器
            ///</summary>
            public class DefaultBuilder : Builder
            {
                /// <summary>
                ///  VqdClient service client
                /// </summary>
                private  VqdClient vqdClient;

                /// <summary>
                ///  默认VqdClient 构造器构造对象
                ///</summary>
                public DefaultBuilder()
                {
                    vqdClient = new VqdClient();
                }

                /// <summary>
                ///  构造VqdClient 对象
                ///</summary>
                public VqdClient Build()
                {
                    if (vqdClient.CredentialsProvider == null)
                    {
                        //if credentialsProvider not set, try load jdcloud global default  credentials provider
                        vqdClient.credentialsProvider = JdCloud.DefaultInstance.GetCredentialsProvider();
                        if (vqdClient.credentialsProvider == null)
                        {
                            throw new ArgumentNullException("VqdClient build error: jdcloud credentials provider not set");
                        }
                    }
                    if (vqdClient.HttpRequestConfig == null)
                    {
                        vqdClient.httpRequestConfig = JdCloud.DefaultInstance.GetHttpRequestConfig();
                        if (vqdClient.httpRequestConfig == null)
                        {
                        throw new ArgumentNullException("VqdClient build error: http request config not set");
                        }
                    }
                    return vqdClient;
                }

                /// <summary>
                /// 设置认证信息参数
                /// </summary>
                /// <param name="provider">认证信息提供对象</param>
                /// <returns>vqdClient 构造器</returns>
                public Builder CredentialsProvider(CredentialsProvider provider)
                {
                    vqdClient.credentialsProvider = provider;
                    return this;
                }

                /// <summary>
                /// 设置请求环境参数
                /// </summary>
                /// <param name="environment">环境参数信息</param>
                /// <returns>vqdClient 构造器</returns>
                public Builder Environment(SDKEnvironment environment)
                {
                    vqdClient.environment = environment;
                    return this;
                }

                /// <summary>
                /// http 请求配置信息
                /// </summary>
                /// <param name="config">http 请求配置信息</param>
                /// <returns>vqdClient 构造器</returns>
                public Builder HttpRequestConfig(HttpRequestConfig config)
                {
                    vqdClient.httpRequestConfig = config;
                    return this;
                }
            }
    }
}
